# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
# Contributor: jepaan <jepaan at hotmail dot com>

pkgname=assimp
pkgver=5.3.1
pkgrel=1
pkgdesc="Library to import various well-known 3D model formats in an uniform manner"
arch=('loong64' 'x86_64')
license=('BSD')
depends=('zlib' 'gcc-libs')
makedepends=('cmake' 'ninja')
url='https://github.com/assimp/assimp'
source=("$pkgname-$pkgver.tar.gz::https://github.com/assimp/assimp/archive/v${pkgver}.tar.gz")
sha512sums=('49963f84ed0a8145f3af249890a533f0b12f5553ae09581289cb1f20cb49cb1a3ed3f3c4c966ceb43aa897b90deca268aa6554066b2bd34f2ac9c15041420ddb')

build() {
  cd ${pkgname}-${pkgver}

  cmake \
    -Bbuild \
    -GNinja \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release \
    -DASSIMP_BUILD_SAMPLES=OFF \
    -DASSIMP_WARNINGS_AS_ERRORS=OFF \
    -DASSIMP_BUILD_ASSIMP_TOOLS=ON
  ninja -C build
}

package()  {
  cd ${pkgname}-${pkgver}

  DESTDIR="$pkgdir" ninja -C build install
  install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}
